package com.cs.demo.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Map;

@Mapper
@Repository
public interface OrderDao {

    @Insert("insert into t_order(price,user_id,status)value(#{price},#{userId},#{status})")
    int insertOrder(@Param("price") BigDecimal price, @Param("userId") Long userId, @Param("status") String status);

    @Select("select * from t_order where user_id=#{userId}")
    Map getUserId(@Param("userId") Long userId);

    @Select("select * from t_order where order_id=#{userId}")
    Map getOrderId(@Param("userId") Long userId);
}
